import { http } from "@/utils/http.js";

//我的收入
export const myIncome = (data) => {
  return http.request({
    method: "get",
    url: "/settle/myIncome",
    params: data,
  });
};

//分类
export const cate = (data) => {
  return http.request({
    method: "get",
    url: "/cate",
    params: { ...data, offLoading: true },
  });
};
//商品
export const productlst = (data) => {
  return http.request({
    method: "get",
    url: "product/lst",
    params: { ...data, offLoading: true },
  });
};

export const bannerlist = (data) => {
  return http.request({
    method: "get",
    url: "/common/banner",
    params: { ...data, offLoading: true },
  });
};

//介绍相关
export const introApi = (data) => {
  return http.request({
    method: "get",
    url: "/base/intro",
    params: data,
  });
};

//营业统计
export const chartBusiness = (data) => {
  return http.request({
    method: "POST",
    url: "app/chart/business",
    data: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

//营业统计
export const chartCategory = (data) => {
  return http.request({
    method: "POST",
    url: "app/chart/category",
    data: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

//营业统计
export const chartProduct = (data) => {
  return http.request({
    method: "POST",
    url: "app/chart/product",
    data: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

//门店统计
export const chartShop = (data) => {
  return http.request({
    method: "POST",
    url: "app/chart/shop",
    data: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

//门店统计
export const chartPayType = (data) => {
  return http.request({
    method: "POST",
    url: "app/chart/payType",

    data: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

//介绍相关
export const openapiPage = (data) => {
  return http.request({
    method: "get",
    url: "openapi/page/" + data,
    header: {
      token: "",
    },
    data: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

//介绍相关
export const shopBanner = (data) => {
  return http.request({
    method: "get",
    url: "openapi/shop/banner",
    header: {
      token: "",
    },
    data: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

//版本更新
export const version = (data) => {
  return http.request({
    method: "get",
    url: "app/version",
    header: {
      token: "",
    },
    data: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};
